package com.gov.dna.admin.entity;

import com.baomidou.mybatisplus.annotations.TableName;
import com.gov.dna.base.entity.BaseNode;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.ibatis.type.Alias;

/**
 * 权限及菜单
 *
 * @author (作者) Dong Jie 154046519@qq.com
 * @version V1.0
 * @date 2019/1/4 11:20
 * @since (该版本支持的JDK版本) 1.8
 */
@Data
@Alias("Permission")
@TableName("admin_permission")
@ApiModel(value = "菜单及权限Entity:Permission")
public class Permission extends BaseNode<Permission> {


    @ApiModelProperty(value = "类型-菜单")
    public final static Integer MENU = 0;
    @ApiModelProperty(value = "类型-权限")
    public final static Integer PERMISSION = 1;
    @ApiModelProperty(value = "类型-资源")
    public final static Integer RESOURCES = 2;
    @ApiModelProperty(value = "类型-URL拦截")
    public final static Integer URL = 3;
    @ApiModelProperty(value = "类型-标签")
    public final static Integer LABEL = 4;

    @ApiModelProperty(value = "名称")
    private String name;

    @ApiModelProperty(value = "类型MENU、PERMISSION、RESOURCES、URL")
    private Integer type;

    @ApiModelProperty(value = "菜单属于哪个模块")
    private Integer menuType;

    @ApiModelProperty(value = "url打开方式 仅针对桌面菜单")
    private Integer openMethod;

    @ApiModelProperty(value = "备注")
    private String note;

    @ApiModelProperty(value = "url")
    private String url;

    @ApiModelProperty(value = "图标")
    private String icon;


    @Override
    public String nodeLabelField() {
        return name;
    }
}
